/*
 Navicat Premium Data Transfer

 Source Server         : stackTest
 Source Server Type    : MySQL
 Source Server Version : 80025
 Source Host           : 120.55.40.9:3306
 Source Schema         : stacktest

 Target Server Type    : MySQL
 Target Server Version : 80025
 File Encoding         : 65001

 Date: 13/08/2021 14:40:01
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for backview
-- ----------------------------
DROP TABLE IF EXISTS `backview`;
CREATE TABLE `backview` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(10) NOT NULL,
  `source_id` int NOT NULL,
  `autor` int NOT NULL,
  `des` varchar(255) NOT NULL,
  `student_id` int NOT NULL,
  `result` varchar(100) NOT NULL,
  `date_time` timestamp NOT NULL DEFAULT '2021-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `method` varchar(20) NOT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `stage_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `BVSTUID` (`student_id`),
  CONSTRAINT `BVSTUID` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of backview
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for baoming
-- ----------------------------
DROP TABLE IF EXISTS `baoming`;
CREATE TABLE `baoming` (
  `id` int NOT NULL AUTO_INCREMENT,
  `autor` int DEFAULT NULL,
  `student_id` int NOT NULL,
  `date_time` timestamp NOT NULL DEFAULT '2021-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `stage_id` int DEFAULT '4',
  PRIMARY KEY (`id`),
  KEY `BMSTUID` (`student_id`),
  CONSTRAINT `BMSTUID` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of baoming
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for contract
-- ----------------------------
DROP TABLE IF EXISTS `contract`;
CREATE TABLE `contract` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `sign` varchar(255) DEFAULT NULL,
  `status` bit(1) NOT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of contract
-- ----------------------------
BEGIN;
INSERT INTO `contract` VALUES (1, '协议', 'http://120.55.40.9', NULL, b'1', 1, '2021-08-12 14:56:38', 1, '2021-08-12 14:56:43', 0);
COMMIT;

-- ----------------------------
-- Table structure for interview
-- ----------------------------
DROP TABLE IF EXISTS `interview`;
CREATE TABLE `interview` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '来访ID',
  `des` varchar(255) DEFAULT NULL COMMENT '备注',
  `flg` bit(1) NOT NULL COMMENT '来访有效开关',
  `date_time` timestamp NOT NULL DEFAULT '2021-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP COMMENT '接待时间',
  `autor` int NOT NULL COMMENT '接待者',
  `ypzw` varchar(20) DEFAULT NULL COMMENT '应聘职位',
  `student_id` int NOT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `stage_id` int DEFAULT '2',
  PRIMARY KEY (`id`),
  KEY `ITVSTUID` (`student_id`),
  CONSTRAINT `ITVSTUID` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of interview
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for payment
-- ----------------------------
DROP TABLE IF EXISTS `payment`;
CREATE TABLE `payment` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '支付ID',
  `p_o_id` int NOT NULL COMMENT '支付类型ID',
  `total_amount` decimal(10,0) NOT NULL COMMENT '总金额',
  `status` varchar(20) NOT NULL COMMENT '状态',
  `request_date` date DEFAULT NULL COMMENT '申请日期',
  `allow_date` date DEFAULT NULL COMMENT '通过日期',
  `run_date` date DEFAULT NULL COMMENT '生效日期',
  `contract_id` int NOT NULL COMMENT '合同ID',
  `number` varchar(50) NOT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `discount` decimal(10,0) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `POID` (`p_o_id`),
  KEY `CONID` (`contract_id`),
  CONSTRAINT `CONID` FOREIGN KEY (`contract_id`) REFERENCES `contract` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `POID` FOREIGN KEY (`p_o_id`) REFERENCES `payment_options` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of payment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for payment_item
-- ----------------------------
DROP TABLE IF EXISTS `payment_item`;
CREATE TABLE `payment_item` (
  `id` int NOT NULL AUTO_INCREMENT,
  `p_id` int DEFAULT NULL,
  `number` int DEFAULT NULL,
  `payable` decimal(20,6) DEFAULT NULL,
  `service` decimal(20,6) DEFAULT NULL,
  `receivables` decimal(20,6) DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `pay_date` datetime DEFAULT NULL,
  `plan_pay_date` datetime DEFAULT NULL,
  `pay_method` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `confirm_user_name` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `confirm_user_id` int DEFAULT NULL,
  `business_t_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `PIID` (`p_id`),
  CONSTRAINT `PIID` FOREIGN KEY (`p_id`) REFERENCES `payment` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of payment_item
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for payment_options
-- ----------------------------
DROP TABLE IF EXISTS `payment_options`;
CREATE TABLE `payment_options` (
  `id` int NOT NULL AUTO_INCREMENT,
  `base` int DEFAULT NULL,
  `main` int DEFAULT NULL,
  `rate` decimal(10,6) DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `status` bit(1) DEFAULT NULL,
  `pay_date` int DEFAULT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of payment_options
-- ----------------------------
BEGIN;
INSERT INTO `payment_options` VALUES (1, 6, 12, 0.550000, '6+12', b'1', 20, 2, '2021-08-12 14:33:01', 2, '2021-08-12 14:37:58', 0);
INSERT INTO `payment_options` VALUES (2, 6, 15, 0.750000, '6+15', b'1', 20, 2, '2021-08-12 14:34:14', 2, '2021-08-12 14:38:03', 0);
INSERT INTO `payment_options` VALUES (3, 6, 18, 0.950000, '6+18', b'1', 20, 2, '2021-08-12 14:35:11', 2, '2021-08-12 14:38:00', 0);
INSERT INTO `payment_options` VALUES (4, 0, 0, 0.000000, '信用卡支付', b'1', 20, 2, '2021-08-12 14:36:18', 2, '2021-08-12 14:38:04', 0);
INSERT INTO `payment_options` VALUES (5, 0, 0, 0.000000, '借记卡支付', b'1', 20, 2, '2021-08-12 14:36:38', 2, '2021-08-12 14:38:05', 0);
INSERT INTO `payment_options` VALUES (6, 0, 0, 0.000000, '支付宝支付', b'1', 20, 2, '2021-08-12 14:36:57', 2, '2021-08-12 14:38:07', 0);
INSERT INTO `payment_options` VALUES (7, 0, 0, 0.000000, '微信支付', b'1', 20, 2, '2021-08-12 14:37:14', 2, '2021-08-12 14:38:08', 0);
INSERT INTO `payment_options` VALUES (8, 0, 0, 0.000000, '现金支付', b'1', 20, 2, '2021-08-12 14:37:36', 2, '2021-08-12 14:38:10', 0);
COMMIT;

-- ----------------------------
-- Table structure for payment_record
-- ----------------------------
DROP TABLE IF EXISTS `payment_record`;
CREATE TABLE `payment_record` (
  `id` int NOT NULL AUTO_INCREMENT,
  `p_id` int DEFAULT NULL,
  `confirm_status` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `confirm_user_name` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `comfirm_time` datetime DEFAULT NULL,
  `status` bit(1) DEFAULT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `PRID` (`p_id`),
  CONSTRAINT `PRID` FOREIGN KEY (`p_id`) REFERENCES `payment` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of payment_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
  `p_id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `p_context` varchar(50) NOT NULL DEFAULT '',
  `status` bit(1) NOT NULL,
  `father_id` int NOT NULL,
  `cu` int NOT NULL DEFAULT '0',
  `ct` datetime NOT NULL DEFAULT '2020-12-01 21:19:08',
  `uu` int NOT NULL DEFAULT '0',
  `ut` datetime NOT NULL DEFAULT '2020-12-01 21:19:08',
  `type` varchar(10) DEFAULT NULL,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`p_id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of permission
-- ----------------------------
BEGIN;
INSERT INTO `permission` VALUES (1, '市场管理', '', b'1', 0, 0, '2020-11-29 22:35:24', 0, '2020-11-29 22:35:29', 'menu', 0);
INSERT INTO `permission` VALUES (2, '信息查重', '/duplication', b'1', 1, 0, '2020-12-01 21:13:31', 0, '2020-12-01 21:13:36', 'menu', 0);
INSERT INTO `permission` VALUES (3, '线索管理', '/resource', b'1', 1, 0, '2020-12-01 21:14:11', 0, '2020-12-01 21:14:17', 'menu', 0);
INSERT INTO `permission` VALUES (4, '到访管理', '/interview', b'1', 1, 0, '2020-12-01 21:15:58', 0, '2020-12-01 21:16:04', 'menu', 0);
INSERT INTO `permission` VALUES (5, '试听管理', '/try', b'1', 1, 0, '2020-12-01 21:17:37', 0, '2020-12-01 21:17:40', 'menu', 0);
INSERT INTO `permission` VALUES (6, '报名管理', '/baoming', b'1', 1, 0, '2020-12-01 21:18:25', 0, '2020-12-01 21:18:28', 'menu', 0);
INSERT INTO `permission` VALUES (7, '回访记录', '/backview', b'1', 1, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:12', 'menu', 0);
INSERT INTO `permission` VALUES (8, '公海线索池', '/publicSea', b'1', 1, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
INSERT INTO `permission` VALUES (9, '信息统计', '/infoStatistics', b'1', 1, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
INSERT INTO `permission` VALUES (20, '系统管理', '', b'1', 0, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
INSERT INTO `permission` VALUES (21, '用户管理', '/user', b'1', 20, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
INSERT INTO `permission` VALUES (22, '角色管理', '/role', b'1', 20, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
INSERT INTO `permission` VALUES (23, '权限管理', '/permission', b'1', 20, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
INSERT INTO `permission` VALUES (24, '可分配', '', b'1', 1, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'page', 0);
INSERT INTO `permission` VALUES (25, '市场统计', '', b'1', 0, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
INSERT INTO `permission` VALUES (26, '市场信息', '/statistics', b'1', 25, 0, '2020-12-01 21:19:08', 0, '2020-12-01 21:19:08', 'menu', 0);
COMMIT;

-- ----------------------------
-- Table structure for project_service
-- ----------------------------
DROP TABLE IF EXISTS `project_service`;
CREATE TABLE `project_service` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `amount` decimal(10,0) NOT NULL,
  `status` bit(1) NOT NULL,
  `des` varchar(255) NOT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of project_service
-- ----------------------------
BEGIN;
INSERT INTO `project_service` VALUES (1, 'Java全栈', 19800, b'1', 'Java基础+数据库+web+JavaEE', 2, '2021-08-12 14:29:14', 1, '2021-08-12 14:41:28', 0);
INSERT INTO `project_service` VALUES (2, 'Web前端', 18800, b'1', '前端基础+前端框架', 2, '2021-08-12 14:30:26', 1, '2021-08-12 14:41:29', 0);
INSERT INTO `project_service` VALUES (3, '项目实训', 9800, b'1', 'SSM+SpringBoot+VUE', 2, '2021-08-12 14:31:15', 1, '2021-08-12 14:41:31', 0);
COMMIT;

-- ----------------------------
-- Table structure for rel
-- ----------------------------
DROP TABLE IF EXISTS `rel`;
CREATE TABLE `rel` (
  `user_id` int NOT NULL,
  `student_id` int NOT NULL,
  `payment_id` int NOT NULL,
  `service_id` int NOT NULL,
  PRIMARY KEY (`user_id`,`student_id`,`payment_id`),
  KEY `STUDENTID` (`student_id`),
  KEY `PAYMENGID` (`payment_id`),
  KEY `SERVICEID` (`service_id`),
  CONSTRAINT `PAYMENGID` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `SERVICEID` FOREIGN KEY (`service_id`) REFERENCES `project_service` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `STUDENTID` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `USERID` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of rel
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for reservation_backview
-- ----------------------------
DROP TABLE IF EXISTS `reservation_backview`;
CREATE TABLE `reservation_backview` (
  `id` int NOT NULL AUTO_INCREMENT,
  `datetime` datetime DEFAULT NULL,
  `autor` int DEFAULT NULL,
  `student_id` int DEFAULT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `stage_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `res_back_stu_id` (`student_id`),
  CONSTRAINT `res_back_stu_id` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of reservation_backview
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for reservation_interview
-- ----------------------------
DROP TABLE IF EXISTS `reservation_interview`;
CREATE TABLE `reservation_interview` (
  `id` int NOT NULL AUTO_INCREMENT,
  `datetime` timestamp NULL DEFAULT NULL COMMENT '预约到访时间',
  `autor` int DEFAULT NULL COMMENT '跟进人',
  `student_id` int DEFAULT NULL COMMENT '学生id',
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `re_stu_id` (`student_id`),
  CONSTRAINT `re_stu_id` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=214 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of reservation_interview
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for reservation_try
-- ----------------------------
DROP TABLE IF EXISTS `reservation_try`;
CREATE TABLE `reservation_try` (
  `id` int NOT NULL AUTO_INCREMENT,
  `datetime` timestamp NULL DEFAULT NULL,
  `autor` int DEFAULT NULL,
  `student_id` int DEFAULT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT NULL,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT NULL,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `res_try_stu_id` (`student_id`),
  CONSTRAINT `res_try_stu_id` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of reservation_try
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for resource
-- ----------------------------
DROP TABLE IF EXISTS `resource`;
CREATE TABLE `resource` (
  `id` int NOT NULL AUTO_INCREMENT,
  `source` varchar(50) DEFAULT NULL COMMENT '线索来源',
  `statu` varchar(10) DEFAULT NULL COMMENT '线索状态',
  `ypzw` varchar(20) DEFAULT NULL COMMENT '应聘职位',
  `csgz` varchar(50) DEFAULT NULL COMMENT '从事过的工作',
  `tdgsmc` varchar(20) DEFAULT NULL COMMENT '投递公司名称',
  `bz` varchar(100) DEFAULT NULL COMMENT '备注',
  `autor` int DEFAULT NULL COMMENT '所属人',
  `student_id` int DEFAULT NULL COMMENT '相关学生ID',
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `stage_id` int DEFAULT '1',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `XSSID` (`student_id`),
  CONSTRAINT `XSSID` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of resource
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for resource_record
-- ----------------------------
DROP TABLE IF EXISTS `resource_record`;
CREATE TABLE `resource_record` (
  `id` int NOT NULL AUTO_INCREMENT,
  `comment` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '资料备注',
  `content` varchar(255) DEFAULT NULL COMMENT '上传的文件或图片路径',
  `autor` int DEFAULT NULL,
  `resource_id` int DEFAULT NULL COMMENT '关联线索id',
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `res_id` (`resource_id`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of resource_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `role_id` int NOT NULL AUTO_INCREMENT,
  `role_name` varchar(30) NOT NULL,
  `cu` int NOT NULL,
  `ct` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int NOT NULL,
  `ut` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `statu` bit(1) NOT NULL,
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (1, '系统管理员', 1, '2021-07-30 14:07:18', 1, '2021-07-30 14:07:18', b'1');
INSERT INTO `role` VALUES (2, '校长', 2, '2021-07-30 14:13:17', 2, '2021-07-30 14:13:17', b'1');
INSERT INTO `role` VALUES (3, '咨询师', 1, '2021-08-13 14:34:02', 1, '2021-08-13 14:34:02', b'1');
INSERT INTO `role` VALUES (4, 'TMK', 1, '2021-08-13 14:34:26', 1, '2021-08-13 14:34:26', b'1');
INSERT INTO `role` VALUES (5, '市场专员', 1, '2021-08-13 14:34:36', 1, '2021-08-13 14:34:36', b'1');
COMMIT;

-- ----------------------------
-- Table structure for role_permission
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
  `role_id` int NOT NULL,
  `permission_id` int NOT NULL,
  PRIMARY KEY (`role_id`,`permission_id`),
  KEY `RPPID` (`permission_id`),
  CONSTRAINT `RPPID` FOREIGN KEY (`permission_id`) REFERENCES `permission` (`p_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `RPRID` FOREIGN KEY (`role_id`) REFERENCES `role` (`role_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of role_permission
-- ----------------------------
BEGIN;
INSERT INTO `role_permission` VALUES (1, 1);
INSERT INTO `role_permission` VALUES (2, 1);
INSERT INTO `role_permission` VALUES (3, 1);
INSERT INTO `role_permission` VALUES (4, 1);
INSERT INTO `role_permission` VALUES (5, 1);
INSERT INTO `role_permission` VALUES (1, 2);
INSERT INTO `role_permission` VALUES (2, 2);
INSERT INTO `role_permission` VALUES (3, 2);
INSERT INTO `role_permission` VALUES (4, 2);
INSERT INTO `role_permission` VALUES (5, 2);
INSERT INTO `role_permission` VALUES (1, 3);
INSERT INTO `role_permission` VALUES (2, 3);
INSERT INTO `role_permission` VALUES (3, 3);
INSERT INTO `role_permission` VALUES (4, 3);
INSERT INTO `role_permission` VALUES (5, 3);
INSERT INTO `role_permission` VALUES (1, 4);
INSERT INTO `role_permission` VALUES (2, 4);
INSERT INTO `role_permission` VALUES (3, 4);
INSERT INTO `role_permission` VALUES (4, 4);
INSERT INTO `role_permission` VALUES (5, 4);
INSERT INTO `role_permission` VALUES (1, 5);
INSERT INTO `role_permission` VALUES (2, 5);
INSERT INTO `role_permission` VALUES (3, 5);
INSERT INTO `role_permission` VALUES (4, 5);
INSERT INTO `role_permission` VALUES (5, 5);
INSERT INTO `role_permission` VALUES (1, 6);
INSERT INTO `role_permission` VALUES (2, 6);
INSERT INTO `role_permission` VALUES (3, 6);
INSERT INTO `role_permission` VALUES (4, 6);
INSERT INTO `role_permission` VALUES (5, 6);
INSERT INTO `role_permission` VALUES (1, 7);
INSERT INTO `role_permission` VALUES (2, 7);
INSERT INTO `role_permission` VALUES (3, 7);
INSERT INTO `role_permission` VALUES (4, 7);
INSERT INTO `role_permission` VALUES (5, 7);
INSERT INTO `role_permission` VALUES (1, 8);
INSERT INTO `role_permission` VALUES (2, 8);
INSERT INTO `role_permission` VALUES (3, 8);
INSERT INTO `role_permission` VALUES (4, 8);
INSERT INTO `role_permission` VALUES (5, 8);
INSERT INTO `role_permission` VALUES (1, 9);
INSERT INTO `role_permission` VALUES (2, 9);
INSERT INTO `role_permission` VALUES (3, 9);
INSERT INTO `role_permission` VALUES (4, 9);
INSERT INTO `role_permission` VALUES (5, 9);
INSERT INTO `role_permission` VALUES (1, 20);
INSERT INTO `role_permission` VALUES (2, 20);
INSERT INTO `role_permission` VALUES (1, 21);
INSERT INTO `role_permission` VALUES (2, 21);
INSERT INTO `role_permission` VALUES (1, 22);
INSERT INTO `role_permission` VALUES (2, 22);
INSERT INTO `role_permission` VALUES (1, 23);
INSERT INTO `role_permission` VALUES (2, 23);
INSERT INTO `role_permission` VALUES (1, 24);
INSERT INTO `role_permission` VALUES (2, 24);
INSERT INTO `role_permission` VALUES (3, 24);
INSERT INTO `role_permission` VALUES (4, 24);
INSERT INTO `role_permission` VALUES (5, 24);
INSERT INTO `role_permission` VALUES (1, 25);
INSERT INTO `role_permission` VALUES (2, 25);
INSERT INTO `role_permission` VALUES (1, 26);
INSERT INTO `role_permission` VALUES (2, 26);
COMMIT;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '学生编号',
  `name` varchar(20) NOT NULL COMMENT '学生姓名',
  `sec_id` varchar(50) DEFAULT NULL COMMENT '身份证ID',
  `sec_front_url` varchar(255) DEFAULT NULL COMMENT '身份证正面',
  `sec_back_url` varchar(255) DEFAULT NULL COMMENT '身份证反面',
  `sec_handle_url` varchar(255) DEFAULT NULL COMMENT '身份证手持',
  `tel` varchar(20) NOT NULL COMMENT '联系电话',
  `account` varchar(50) DEFAULT NULL COMMENT '银行账户',
  `account_tel` varchar(20) DEFAULT NULL COMMENT '银行预留电话',
  `address` varchar(255) DEFAULT NULL COMMENT '联系地址',
  `e_mail` varchar(50) DEFAULT NULL COMMENT '邮件',
  `degree` varchar(10) DEFAULT NULL COMMENT '学历',
  `major` varchar(255) DEFAULT NULL COMMENT '专业',
  `graduate` varchar(50) DEFAULT NULL COMMENT '毕业院校',
  `birth` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `graduate_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of student
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for try
-- ----------------------------
DROP TABLE IF EXISTS `try`;
CREATE TABLE `try` (
  `id` int NOT NULL AUTO_INCREMENT,
  `date_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `autor` int NOT NULL,
  `des` varchar(255) DEFAULT NULL,
  `statu` varchar(10) NOT NULL,
  `student_id` int NOT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0' COMMENT '逻辑删除字段',
  `stage_id` int DEFAULT '3',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `TSTUID` (`student_id`),
  CONSTRAINT `TSTUID` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of try
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `user_id` int NOT NULL AUTO_INCREMENT,
  `account` varchar(20) NOT NULL,
  `password` varchar(20) NOT NULL,
  `nick_name` varchar(20) DEFAULT NULL,
  `age` int DEFAULT NULL,
  `sex` bit(1) DEFAULT NULL,
  `tel` varchar(20) DEFAULT NULL,
  `sec_id` varchar(50) DEFAULT NULL,
  `head_img` varchar(255) DEFAULT NULL,
  `open_id` varchar(100) NOT NULL,
  `cu` int DEFAULT NULL,
  `ct` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `uu` int DEFAULT NULL,
  `ut` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`user_id`),
  KEY `ROLE_ID` (`open_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'admin', '123456', '田春雷', 29, b'1', '18842681421', '2113021992031904xx', '/img/xxx', 'Abcdefg', 1, '2021-08-12 13:52:02', 1, '2021-08-12 13:52:02', 0);
INSERT INTO `user` VALUES (2, 'xiaozhang', '123456', '刘校长', 29, b'1', '13488888888', '210133444498xx', '/img/yyy', 'higklmn', 2, '2021-08-12 13:52:08', 2, '2021-08-12 13:52:08', 0);
INSERT INTO `user` VALUES (3, 'zixun1', '123456', '咨询师1', 22, b'0', '13488889999', '210133444498xx', '/img/aaa', 'tyuiop', 1, '2021-08-12 13:53:08', NULL, '2021-08-12 13:53:08', 0);
INSERT INTO `user` VALUES (4, 'zixun2', '123456', '电话销售1', 29, b'1', NULL, NULL, NULL, 'rrghjkl', NULL, '2021-08-12 13:53:29', NULL, '2021-08-12 13:53:29', 0);
INSERT INTO `user` VALUES (5, 'shichang1', '123456', '市场专员1', 30, b'1', NULL, NULL, NULL, 'ppppp', NULL, '2021-08-12 14:39:05', NULL, '2021-08-12 14:39:05', 0);
COMMIT;

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  PRIMARY KEY (`user_id`,`role_id`),
  KEY `URRID` (`role_id`),
  CONSTRAINT `URRID` FOREIGN KEY (`role_id`) REFERENCES `role` (`role_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `URUID` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` VALUES (1, 1);
INSERT INTO `user_role` VALUES (2, 2);
INSERT INTO `user_role` VALUES (3, 3);
INSERT INTO `user_role` VALUES (4, 4);
INSERT INTO `user_role` VALUES (5, 5);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
